Repunit
In recreational mathematics, a repunit is a number like 11, 111, or 1111 that contains only the digit 1 — a more specific type of repdigit. A repunit prime is a repunit that is also a prime number. In the sections below, R''n'' is the repunit with length n'', e.g. ''R''10 = 111111111111. Repunit prime The definition of repunits was motivated by recreational mathematicians looking for prime factors of such numbers. It is easy to show that if ''n is divisible by a'', then ''Rn''(''b) is divisible by R''a''(b''): : R_n^{(b)}=\frac{1}{b-1}\prod_{d|n}\Phi_d(b), where \Phi_d(x) is the d^\mathrm{th} cyclotomic polynomial and ''d ranges over the divisors of n''. For ''p prime, : \Phi_p(x)=\sum_{i=0}^{p-1}x^i, which has the expected form of a repunit when x'' is substituted with ''b. For example, 10 is divisible by 2, 3, 4, and 6, thus R''10 is divisible by ''R''2, ''R''3, ''R''4, and ''R''6, in fact, 111111111111 = 11 · 10101010101 = 111 · 1001001001 = 1111 · 100010001 = 111111 · 1000001, the corresponding cyclotomic polynomials \Phi_2(x) and \Phi_3(x) and \Phi_4(x) and \Phi_6(x) and \Phi_{10}(x) are x+1 and x^2+x+1 and x^2+1 and x^2-x+1 and x^4-x^2+1 , respectively (the algebraic factors of ''R''10 = 111111111111 is 11 · E1 · 101 · 111 · EE01). Thus, for ''Rn'' to be prime, ''n must necessarily be prime, but it is not sufficient for n'' to be prime. For example, ''R''7 = 1111111 = 46E · 2X3E is not prime. Except for the case of ''R''E = 11111111111 = E · 1E · 754E2E41, ''p can only divide R''n'' for prime n'' if ''p = 2''kn'' + 1 for some k''. R''n is known to be prime for n'' = 2, 3, 5, 17, 81, 91, 225, 255, 4X5, and R''n is probable prime for n'' = 5777, 879E, 198E1, 23175, 311407. (Note that 879E is the only known such ''n ends with E) RXE/19E is a X8-digit prime (XE is the only known prime p'' such that R''p/(2''p''+1) is prime). The largest two prime factors of R141 both have 60 digits, and these two prime factors are very close. If n'' is composite, then R''n is also composite (e.g. 2E = 5 × 7, and R2E = 11111111111111111111111111111111111 = 11111 × 1000010000100001000010000100001 = 1111111 × 10000001000000100000010000001), however, when n'' is prime, R''n may not be prime, the first example is n''=7, although 7 is prime, R7 = 1111111 is not prime, it equals 46E × 2X3E. Theorem If ''p is prime other than E, then every prime factor of Rp is = 1 mod p''. (e.g. ''R''7 = 46E × 2X3E, and both 46E and 2X3E are = 1 mod 7) If ''p is Sophie Germain prime other than 2, 3 and 5, then Rp is composite, since Rp must be divisible by 2''p''+1. (e.g. 1E|''R''E, 3E|''R''1E, 4E|''R''25, 6E|''R''35, 8E|''R''45, 11E|''R''6E, 12E|''R''75, 16E|''R''95, 19E|''R''XE) (by the way, R''2, ''R''3 and ''R''5 are all primes) If ''p is prime other than 2, 3 and E, then p'' divides ''Rp-1, however, some composite numbers c'' also divide ''Rc''−1, the first such example is 55, which divides ''R''54, such composites are called deceptive primes. For prime ''p other than 2, 3 and E, the smallest integer n'' ≥ 1 such that ''p divides Rn is the period length of 1/''p'', e.g. none of 1, 11, 111, 1111 and 11111 is divisible by 17, but 111111 is, and the period length of 1/17 is 6: 1/17 = 0.076E45 All repunit composite with prime length except R''E are Fermat pseudoprime (also Euler pseudoprime, Euler-Jacobi pseudoprime and strong pseudoprime) base 10. If ''n is Fermat pseudoprime base 10, then Rn is also Fermat pseudoprime base 10 (thus, there are infinitely many Fermat pseudoprimes base 10). * If (and only if) n'' is divisible by 2, then ''Rn is divisible by 11. * If (and only if) n'' is divisible by 3, then ''Rn is divisible by 111. * If (and only if) n'' is divisible by 4, then ''Rn is divisible by 5 and 25. * If (and only if) n'' is divisible by 5, then ''Rn is divisible by 11111. * If (and only if) n'' is divisible by 6, then ''Rn is divisible by 7 and 17. * If (and only if) n'' is divisible by 7, then ''Rn is divisible by 46E and 2X3E. * If (and only if) n'' is divisible by 8, then ''Rn is divisible by 75 and 175. * If (and only if) n'' is divisible by 9, then ''Rn is divisible by 31 and 3X891. * If (and only if) n'' is divisible by X, then ''Rn is divisible by E0E1. * If (and only if) n'' is divisible by E, then ''Rn is divisible by E, 1E, and 754E2E41. * If (and only if) n'' is divisible by 10, then ''Rn is divisible by EE01. * Let p'' be a prime >3, ''m is the smallest integer ≥1 such that Rm is divisible by p'', then if (and only if) ''n is divisible by m'', then ''Rn is divisible by p''. * Since there are no squares = 11 mod 100, thus the only repunit which is square is 1, in fact, the only repunit which is perfect power is 1. * ''Rn is Harshad number if and only if n'' is power of E (include 1). * If ''p is prime differ from 2, 3, and E, then p'' divides ''Rp''−1. * If ''p is prime differ from E, then p'' divides ''Rp−1. Example of E01-type numbers * R''10 = 11222211 × EE0'1''' * R''13 = 1233321 × E00E0EE'1''' * R''18 = 112222222211 × EE00EE0'1''' * R''19 = 123333321 × E00E00EE0EE'1''' * R''20 = 112233332211 × EE0000EEEE0'1''' * R''20 = 1111222222221111 × EEEE000'1''' * R''24 = 1122222222222211 × EE00EE00EE0'1''' * R''26 = 11223333332211 × EE0000EE00EEEE0'1''' * R''26 = 111222222222222111 × EEE000EEE00'1''' * R''26 = 11111222222222211111 × EEEEE0000'1''' * R''26 = 1011121222222221211101 × '''1'0EXXE0'11' * R''29 = 1233333333321 × E00E00E00E0EE0EE0EE'1''' * R''2E = 12345554321 × E0000E0E00E0E0EE0E0EEEE'1''' * R''30 = 11222222222222222211 × EE00EE00EE00EE0'1''' * R''30 = 111222333333222111 × EEE000000EEEEEE00'1''' * R''30 = 111111222222222222111111 × EEEEEE00000'1''' * R''34 = 1122334444332211 × EE000000EEEE0000EEEEEE0'1''' * R''34 = 111122222222222222221111 × EEEE0000EEEE000'1''' * R''36 = 112233333333332211 × EE0000EE0000EEEE00EEEE0'1''' * R''36 = 111222222222222222222111 × EEE000EEE000EEE00'1''' * R''36 = 1111111222222222222221111111 × EEEEEEE000000'1''' * R''36 = 101111121222222222222121111101 × '''1'0EXE00EXE0'11' * R''38 = 112222222222222222222211 × EE00EE00EE00EE00EE0'1''' * R''39 = 1234555554321 × E0000E000EE000EE00EEE00EEE0EEEE'1''' * R''39 = 111222333333333222111 × EEE000000EEE000EEEEEE00'1''' * R''40 = 11223333333333332211 × EE0000EE0000EE00EEEE00EEEE0'1''' * R''40 = 111122223333333322221111 × EEEE00000000EEEEEEEE000'1''' * R''40 = 11111111222222222222222211111111 × EEEEEEEE0000000'1''' * R''6 = 11 × (E0E1 + 1010) * ''R''8 = 11 × (E0E0E1 + 101010) * ''R''X = 11 × (E0E0E0E1 + 10101010) * ''R''10 = 11 × (E0E0E0E0E1 + 1010101010) Example of numbers containing only 0 and 1 Factorization of dozenal repunits (Prime factors colored red means "new factors", i.e. the prime factors dividing R''n but not dividing R''k'' for any k'' < ''n) R1 = 1 R2 = 11 R3 = 111 R4 = 5 × 11 × 25 R5 = 11111 R6 = 7 × 11 × 17 × 111 R7 = 46E × 2X3E R8 = 5 × 11 × 25 × 75 × 175 R9 = 31 × 111 × 3X891 RX = 11 × E0E1 × 11111 RE = E × 1E × 754E2E41 R10 = 5 × 7 × 11 × 17 × 25 × 111 × EE01 R11 = 1E0411 × 69X3901 R12 = 11 × 157 × 46E × 2X3E × 7687 R13 = 51 × 111 × 471 × 57E1 × 11111 R14 = 5 × 11 × 15 × 25 × 75 × 81 × 175 × 106X95 R15 = X9X9XE × 126180EE0EE R16 = 7 × 11 × 17 × 31 × 111 × E61 × 1061 × 3X891 R17 = 1111111111111111111 R18 = 52 × 11 × 25 × E0E1 × 11111 × 24727225 R19 = 111 × 46E × 2X3E × E00E00EE0EE1 R1X = E × 11 × 1E × 754E2E41 × E0E0E0E0E1 R1E = 3E × 78935EX441 × 523074X3XXE R20 = 5 × 7 × 11 × 17 × 25 × 75 × 111 × 141 × 175 × EE01 × 8E5281 R21 = 11111 × 1277EE × 9X06176590543EE R22 = 112 × 67 × 18X31 × X8837 × 1E0411 × 69X3901 R23 = 31 × 111 × 3X891 × 129691 × 9894576430231 R24 = 5 × 11 × 25 × 157 × 46E × 481 × 2X3E × 7687 × 2672288X41 R25 = 4E × 123EE × 15960E × 160605E10497012E4E R26 = 7 × 11 × 17 × 27 × 51 × 111 × 2E1 × 471 × 57E1 × E0E1 × 11111 × 18787 R27 = 271 × 365E0031 × 464069563E × 39478E3664E R28 = 5 × 11 × 15 × 25 × 75 × 81 × 175 × 75115 × 106X95 × 1748E3674115 R29 = E × 1E × 111 × 368E51 × 2013881 × 754E2E41 × 16555E1X1 R2X = 11 × 1587 × X9X9XE × 126180EE0EE × 7605857409257 R2E = 5E × 34E × 46E × 2X3E × 11111 × 32XXE1 × 205812E × EX59849E R30 = 5 × 7 × 11 × 17 × 25 × 31 × 61 × 111 × E61 × 1061 × EE01 × 3X891 × 1E807X62E61 R31 = 1398641 × 9E2X6732EE74552406X78E76247691 R32 = 11 × 1XE7 × 4901 × 127543624027 × 1111111111111111111 R33 = 111 × 19491 × 1E0411 × 5XE48X1 × 69X3901 × 1064119E745041 R34 = 52 × 11 × 25 × 35 × 75 × 175 × 375 × E0E1 × 11111 × 62041 × 1X7X9741 × 24727225 R35 = 6E × 472488E21 × 4E2EX47X7863X18E5E18253377315E R36 = 72 × 11 × 17 × 37 × 111 × 157 × 46E × 2X3E × 7687 × 9X17 × 76E077 × E00E00EE0EE1 R37 = 2EE × 4159911 × 273263674E × 4X748X0X65EXX3943375X351 R38 = 5 × E × 11 × 1E × 25 × 1461 × 2181 × 3801 × 754E2E41 × E0E0E0E0E1 × 113006390X1 R39 = 31 × 51 × 111 × 471 × 57E1 × 11111 × 15991 × 3X891 × 1905201 × 7229231 × 7843701 R3X = 11 × 3E × 591 × 7231 × 78935EX441 × 523074X3XXE × 3266712021E531E1 R3E = 832966217X8X111 × 16EE6202E02X5311278504010EX13001 R40 = 5 × 7 × 11 × 15 × 17 × 25 × 75 × 81 × 111 × 141 × 175 × 4541 × EE01 × 1E601 × 106X95 × 8E5281 × 146609481 The product of "new factors" (i.e. the prime factors dividing R''n'' but not dividing R''k'' for any k'' < ''n) of R''n'' is Φ''n''(10)/GCD(Φ''n''(10),n''), except ''n = 1 and n'' = E (in which cases, the two numbers are 1 and E for ''n = 1, and they are 11111111111 (= RE) and 123456789E for n'' = E)). In fact, the repunit R''n = Π''d''|''n'', d''>1(Φ''d(10)), where Φ''d''(10) is the d''th cyclotomic polynomial evaluated at 10. Properties * Any positive multiple of the repunit ''Rn contains at least n'' nonzero digits. * The only known numbers that are repunits with at least 3 digits in more than one base simultaneously are 27 (111 in base 5, 11111 in base 2) and 48X7 (111 in base 76, 1111111111111 in base 2). The Goormaghtigh conjecture says there are only these two cases. * Using the pigeon-hole principle it can be easily shown that for each ''n and b'' such that ''n and b'' are relatively prime there exists a repunit in base ''b that is a multiple of n''. To see this consider repunits ''R''1(''b),...,Rn(b''). Because there are ''n repunits but only n''-1 non-zero residues modulo ''n there exist two repunits Ri(b'') and ''Rj(b'') with 1≤''i<''j''≤''n'' such that Ri(b'') and ''Rj(b'') have the same residue modulo ''n. It follows that Rj(b'') - ''Ri(b'') has residue 0 modulo ''n, i.e. is divisible by n''. ''Rj(b'') - ''Ri(b'') consists of ''j - i'' ones followed by ''i zeroes. Thus, Rj(b'') - ''Ri(b'') = ''Rj-''i''(b'') x ''bi . Since n'' divides the left-hand side it also divides the right-hand side and since ''n and b'' are relatively prime ''n must divide Rj-''i''(b''). e.g. for every 5-rough number ''n, there exists a repunit in base 10 that is a multiple of n''. * The Feit–Thompson conjecture is that ''Rq(p'') never divides ''Rp(q'') for two distinct primes ''p and q''. * Using the Euclidean Algorithm for repunits definition: ''R''1(''b) = 1; Rn(b'') = ''Rn-1(b'') x ''b + 1, any consecutive repunits Rn-1(b'') and ''Rn(b'') are relatively prime in any base ''b for any n''. * If ''m and n'' are relatively prime, ''Rm(b'') and ''Rn(b'') are relatively prime in any base ''b for any m'' and ''n. The Euclidean Algorithm is based on gcd(m'', ''n) = gcd(m'' - ''n, n'') for ''m > n''. Similarly, using ''Rm(b'') - ''Rn(b'') × ''bm-''n'' = Rm-''n''(b''), it can be easily shown that ''gcd(Rm(b''), ''Rn(b'')) = ''gcd(Rm-''n''(b''), ''Rn(b'')) for ''m > n''. Therefore if ''gcd(m'', ''n) = 1, then gcd(Rm(b''), ''Rn(b'')) = ''R''1(''b) = 1. * If r'' is a divisor of ''b−1, then the remainder of Rn(b'') modulo ''r is equal to the remainder of n'' modulo ''r, e.g. the remainder of Rn(10) modulo E is equal to the remainder of n'' modulo E. * Repunits in base 10 are related the cyclic patterns of repeating dozenals, it was found very early on that for any prime ''p greater than 3 except E, the period of the dozenal expansion of 1/''p'' is equal to the length of the smallest repunit number that is divisible by p''. * The only one repunit prime in base 4 is 5 (=114). * The only one repunit prime in base 8 is 61 (=1118). * The only one repunit prime in base 14 is 15 (=1114). * The only one repunit prime in base 23 is 531 (=11123). * The only one repunit prime in base 30 is 31 (=1130). * The only one repunit prime in base 84 is 85 (=1184). * The only one repunit prime in base X8 is 5E70EX5X8801 (=1111111X8). * There are no repunit primes in bases 9, 21, 28, 41, 54, 69, X1, X5, 100, ..., because of algebraic factors, especially, all repunits in base 9 are triangular numbers, and no triangular numbers >3 are primes. * Every perfect power base has at most one generalized repunit prime (since generalized repunits in these bases can be factored algebraically), and it is conjectured every non-perfect power base has infinitely many generalized repunit primes (there is at least one known repunit prime or repunit PRP with length < 3000 for ''all non-perfect power bases 2<=b<=100, and except base 43 (=3*15) and base 77 (=7*11), all other non-perfect power bases 2<=b<=100 have at least one known proven repunit prime with length < 1000, besides, base 43 and base 77 also have one known repunit PRP with length < 3000, (43^2545-1)/42 and (77^2685-1)/76. List of repunit primes base b We also consider “negative primes” (e.g. R2(−10) = −E) as primes, since they are primes in the domain Z (the set of all integers). Demlo numbers Kaprekar has defined Demlo numbers as concatenation of a left, middle and right part, where the left and right part must be of the same length (up to a possible leading zero to the left) and must add up to a repdigit number, and the middle part may contain any additional number of this repeated digit , . They are named after Demlo railway station 30 miles from Bombay on the then G.I.P. Railway, where Kaprekar started investigating them. He calls Wonderful Demlo numbers those of the form 1, 121, 12321, 1234321, ..., 123456789XEX987654321. The fact that these are the squares of the repunits has led some authors to call Demlo numbers the infinite sequence of these , 1, 121, 12321, 1234321, ..., 123456789XEX987654321, 123456789E00EX987654321, 123456789E0120EX987654321, ..., although one can check these are not Demlo numbers for n = 10, 1E, 2X, ... Category:Pages